import {fromJS} from "immutable";
import {constants} from "./index";

const defaultState = fromJS({
    login: false,//标识用户是否登录
})
const reducer = (state = defaultState, action) => {
    switch (action.type) {
        case constants.CHANGE_LOGIN:
            return state.set('login', action.value);
        case constants.LOGOUT:
            return state.set('login', action.value);
        default:
            return state;
    }
};
export default reducer;